import axios from '@/axios'

// 新建对话
export function newChat(message: string) {
  return axios.post('/new', { message })
}

// 流式对话
export function completion(params) {
  return axios.post('/completion', { params })
}

// 获取对话的历史消息
export function getHistoryMsg(params) {
  return axios.post('/history/msg', params)
}

// 获取历史对话
export function getHistoryChats() {
  return axios.post('/history/chat', {})
}

export function delChat(params) {
  return axios.post('/del', params)
}

/**
 *
 * @param params 重命名对话
 * @returns
 */
export function renameChat(params) {
  return axios.post('/rename', params)
}
